home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / misc / gs261src.zip / gxcolor.h < prev    next >
C/C++ Source or Header  |  1993-05-17  |  2KB  |  61 lines

  1. /* Copyright (C) 1992, 1993 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* gxcolor.h */
  20. /* Client color structure definition */
  21. #include "gxfrac.h"
  22. #include "gsuid.h"
  23.  
  24. struct gs_client_color_s;
  25. typedef struct gs_client_color_s gs_client_color;
  26.  
  27. /* Paint (non-pattern) colors (Device, CIE, Indexed, Separation) */
  28. typedef struct gs_paint_color_s {
  29.     float values[4];
  30. } gs_paint_color;
  31.  
  32. /* Pattern */
  33. typedef struct gs_pattern_s {
  34.     gs_uid uid;        /* XUID or nothing */
  35.     int PaintType;
  36.     int TilingType;
  37.     gs_rect BBox;
  38.     float XStep;
  39.     float YStep;
  40.     int (*PaintProc)(P2(gs_client_color *, gs_state *));
  41. } gs_pattern;
  42.  
  43. /* General colors */
  44. struct gs_client_color_s {
  45.     gs_paint_color paint;        /* also color for uncolored pattern */
  46.     gs_pattern pattern;
  47. };
  48.  
  49. /* Color representation conversion routines */
  50. void color_hsb_to_rgb(P4(floatp h, floatp s, floatp b, float rgb[3]));
  51. void color_rgb_to_hsb(P4(floatp r, floatp g, floatp b, float hsb[3]));
  52. /* Color space conversion routines */
  53. frac color_rgb_to_gray(P4(frac r, frac g, frac b,
  54.   const gs_state *pgs));
  55. void color_rgb_to_cmyk(P5(frac r, frac g, frac b,
  56.   const gs_state *pgs, frac cmyk[4]));
  57. frac color_cmyk_to_gray(P5(frac c, frac m, frac y, frac k,
  58.   const gs_state *pgs));
  59. void color_cmyk_to_rgb(P6(frac c, frac m, frac y, frac k,
  60.   const gs_state *pgs, frac rgb[3]));
  61.